package com.relife.core.socket;

import org.apache.log4j.Logger;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

@Configuration
@EnableWebSocket
public class MisWebSocketConfigurer implements WebSocketConfigurer {
	private static final Logger log = Logger.getLogger("MisWebSocketConfigurer");

	@Override
	public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
		registry.addHandler(new MisWebSocketHandler(), "/webSocket.ws").addInterceptors(new MisHandshakeInterceptor());
		log.info("开始注册webSocket...");
	}

}
